Skip to content

Refactor error and response handling in Fastify plugins#77

Merged
mitchknife merged 2 commits intoFacilityApi:masterfrom
mitchknife:fastify-fixes
Dec 11, 2025
Merged

Refactor error and response handling in Fastify plugins#77
mitchknife merged 2 commits intoFacilityApi:masterfrom
mitchknife:fastify-fixes

Conversation

@mitchknife
Copy link
Contributor

@mitchknife mitchknife commented Dec 11, 2025

  • Introduced sendResponse and sendErrorResponse to simplify common cases.
  • Being explicit about Content-Type header.
  • Cleaned up code flow
  • Cleaned up error handling and messages.

This also reverts the change that made returned values explicit from version 3.7.0. That change didn't actually improve the snyk reports. Being explicit about the Content-Type header was the trick 👍🏼

- Introduced `sendResponse` and `sendErrorResponse` to simplify common cases.
- Being explicit about Content-Type header.
- Cleaned up code flow
- Cleaned up error handling and messages.
@mitchknife mitchknife merged commit 32b2d85 into FacilityApi:master Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant